USE [DTP]
GO

/****** Object:  StoredProcedure [dbo].[UpdateAccidentCard]    Script Date: 11/26/2010 14:02:12 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO



CREATE PROCEDURE [dbo].[UpdateVehicleCard]
	@id bigint,
	@enginNumber nvarchar(50) = NULL,
     @bodyNumber nvarchar(50) = NULL,
        @chassisNumber nvarchar(50) = NULL,
        @creationYear int = NULL, 
        @passangersAmmount int = NULL,  
        @trailerAmmount int = NULL,  
        @carIdNumber nvarchar(50) = NULL,
        @carRegistrationCardNumber nvarchar(50) = NULL,   
        @vehicleNumber nvarchar(1024) = NULL,
        
        @escape int = NULL, 
        @vehicleType int = NULL,        
        @color int = NULL, 
        @malfunctions int = NULL, 
        @factoryCode int = NULL, 
        @modelCode int = NULL, 
        @wheelAndDrive int = NULL,         
        @damagePlaces int = NULL,        
        @registrationRegion int = NULL,       
        @organizationType int = NULL, 
        @ownershipType int = NULL, 
        @organizationName int = NULL, 
        @haveLicence int = NULL, 
        @inSearch int = NULL 
	
AS
BEGIN
	SET NOCOUNT ON;
		
    UPDATE dbo.t_VehicleCards 
    SET 
    		enginNumber = @enginNumber,
			bodyNumber =     @bodyNumber,
			chassisNumber =        @chassisNumber,
creationYear =        @creationYear,
passangersAmmount =        @passangersAmmount,
trailerAmmount =        @trailerAmmount,
carIdNumber =        @carIdNumber,
carRegistrationCardNumber =        @carRegistrationCardNumber,  
vehicleNumber =       @vehicleNumber,
        
[escape] =        @escape,
vehicleType =        @vehicleType,        
color =        @color, 
malfunctions =        @malfunctions,
factoryCode =        @factoryCode, 
modelCode =        @modelCode,
wheelAndDrive =        @wheelAndDrive,       
damagePlaces =        @damagePlaces,        
registrationRegion =        @registrationRegion,     
organizationType  =      @organizationType, 
ownershipType =        @ownershipType,
organizationName =        @organizationName, 
haveLicence =        @haveLicence, 
inSearch =        @inSearch
    WHERE id = @id;
END


GO


